<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2023 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
declare(strict_types=1);

namespace TpAmis\middleware;

use Closure;
use think\App;
use think\Request;
use think\Response;
use TpAmis\builder\FormBuilder;
use TpAmis\builder\FormPage;
use TpAmis\builder\PageBuilder;
use TpAmis\builder\TableBuilder;
use TpAmis\builder\TablePage;
use TpAmis\util\AmisConfig;
use think\facade\Config;
use think\facade\View;

/**
 * AmisInit 初始化
 * 用于初始化 TpAmis 的配置
 */
class AmisInit
{
    /**
     * Session初始化
     * @access public
     * @param Request $request
     * @param Closure $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {
        AmisConfig::setConfig(Config::get('TpAmis'));
        
        return $next($request);
    }

}
